package view;

import javax.swing.JPanel;

import net.miginfocom.swing.MigLayout;

/**
 * This class manages the meetings view window
 * 
 * The template view contains the preview and navigation view.
 * 
 * @author buthainahaldosary
 * @since May 31, 2013
 * @version $Revision: 1.0 $
 */

public class MeetingsView 
{
	/**
	 * preview view and navigation view used in current view.
	 */
	private PreviewMeetingView previewView;
	private MeetingNavigationView navigationView;
	JPanel jPanel;
	
	/**
	 * Constructor that triggers the initializes components function.
	 */
	public MeetingsView(){
		initializeComponents();
	}
	
	/**
	 * Initialize the child components.
	 */
	private void initializeComponents() {
		navigationView = new MeetingNavigationView(new MigLayout("fillx"));
		previewView = new PreviewMeetingView(new MigLayout("fillx"));		
	}

	/**
	 * Creates a JOption Pane with the components and shows it as a dialog.
	 */
	public void showDialog(){
		jPanel = new JPanel(new MigLayout("fillx, width 400:600:800"));
		jPanel.add(previewView, "wrap,growx");
		jPanel.add(navigationView, "dock west");
		ViewHelpers.showDialog(jPanel, "Meetings");

	}
	/**
	 * 
	
	 * @return the preview view. */
	public PreviewMeetingView getPreviewView() {
		return previewView;
	}
	/**
	 * 
	
	 * @return the navigation view */
	public MeetingNavigationView getNavigationView() {
		return navigationView;
	}
	
	
}
